package com.yinhe.music.yhmusic.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.common.GlideHelper.GlideHelper;
import com.yinhe.music.yhmusic.R;
import com.yinhe.music.yhmusic.model.Music;

/**
 * Created by hasee on 2017/8/15.
 */

public class RecommendAlbumAdapter extends BaseQuickAdapter<Music, BaseViewHolder> {

    public RecommendAlbumAdapter() {
        super(R.layout.recommend_music_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, Music item) {
        helper.setText(R.id.song_name, item.getSongName())
                .setText(R.id.singer_name, item.getSingerName())
                .addOnClickListener(R.id.iv_play)
                .addOnClickListener(R.id.playlist_more);
        ImageView image = helper.getView(R.id.song_image);
        GlideHelper.setImageResource(image, item.getImage(), R.drawable.default_cover);

//        String quality = item.getQualityLevel();
//        if (quality != null) {
//            switch (quality) {
//                case IConstants.Common:
//                    helper.setImageResource(R.id.song_quality, R.drawable.ic_regular);
//                    break;
//                case IConstants.HQ:
//                    helper.setImageResource(R.id.song_quality, R.drawable.ic_hq);
//                    break;
//                case IConstants.SQ:
//                    helper.setImageResource(R.id.song_quality, R.drawable.ic_sq);
//                    break;
//            }
//        }
    }
}
